package com.lck.blogmanager.exception;

public class BusinessException extends RuntimeException {

    public BusinessException(Integer code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public BusinessException(Integer code, String msg, Object... args) {
        super(msg);
        this.code = code;
        this.msg = msg;
        this.args = args;
    }

    public BusinessException(String msg) {
        this(-1, msg);
    }

    public BusinessException(String msg, Object... args) {
        this(-1, msg, args);
    }

    private Integer code;
    private String msg;
    private Object[] args;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Object[] getArgs() {
        return args;
    }

    public void setArgs(Object[] args) {
        this.args = args;
    }
}
